sudo yum update kernel -y
sudo yum install -y kernel kernel-headers kernel-devel gcc make
sudo yum install -y dkms elfutils-libelf-devel
sudo yum install -y RemoteBox fence-agents-vbox libvirt-daemon-driver-vbox libvirt-daemon-vbox

grep "alias cls='clear'" ~/.bashrc > /dev/null
if [ $? -eq 0 ]; then
    echo "alias was seted."
else
cat >> ~/.bashrc <<-EOF
alias cls='clear'
alias yum='sudo yum'
alias yumi='yum install -y'
alias yumr='yum remove -y'
alias yums='yum search'
alias dnf='sudo dnf'
alias dnfi='dnf install -y'
alias dnfr='dnf remove -y'
alias dnfs='dnf search'
alias npm='sudo npm'
alias cnpm='sudo cnpm'
alias yarn='sudo yarn'
alias pip='sudo pip --trusted-host mirrors.aliyun.com'
alias pipi='pip install'
alias ci='conda install -y'
alias vim='sudo vim'
alias nvim='sudo nvim'
alias vi='vim'
alias l='ls -al'
alias ll='ls -l'
alias mv='mv -i'
alias cp='cp -i'
alias rm='rm -i'
export PAGER=most
export BROWSER=firefox
export EDITOR=nvim
export LANG=zh_CN.UTF-8
EOF
source ~/.bashrc
fi

sudo yum install -y yum-fastestmirror

sudo yum install -y wget curl git tree

sudo yum install -y epel-release

sudo yum install -y ntp net-tools sysstat
sudo yum install -y chromium
sudo yum install -y tree vim dos2unix
sudo yum install -y terminator
sudo yum install -y kernel-devel
sudo yum install -y gcc cpp gcc-c++ gd-devel glibc-doc
sudo yum install -y ncurses ncurses-devel
sudo yum install -y zlib zlib-devel
sudo yum install -y freetype-devel freetype-demos freetype-utils
sudo yum install -y openssl openssl-devel
sudo yum install -y openssh-server
sudo yum install -y bzip2-devel sqlite-devel
sudo yum install -y python3-devel
sudo yum install -y java-latest-openjdk
sudo yum install -y manpages-posix-dev
sudo yum install -y man-pages man-db 
sudo yum install -y man2html help2man most
sudo yum install -y rust cargo golang
sudo yum install -y kate gedit

sudo yum install -y nodejs npm
sudo npm config set registry https://registry.npmmirror.com
sudo npm i -g npm
sudo npm i -g cnpm --registry https://registry.npmmirror.com
sudo npm i -g yarn --registry https://registry.npmmirror.com
sudo npm i -g pnpm --registry https://registry.npmmirror.com

sudo yum install -y python3
sudo yum install -y python3-pip 
sudo yum install -y python3-setuptools
sudo yum install -y python3-ipython
sudo yum install -y python-is-python3
sudo yum install -y pipx

[ -e ~/.pip ] || sudo mkdir ~/.pip
[ -e ~/.pip/pip.conf ] || sudo touch ~/.pip/pip.conf
sudo chmod a+w ~/.pip/pip.conf
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
pip config set install.trusted-host pypi.tuna.tsinghua.edu.cn

pip install --user --upgrade pip --trusted-host mirrors.aliyun.com

pip install --user --trusted-host mirrors.aliyun.com flake8 jedi isort yapf pygments ptpython

sudo yum install -y bat zsh 
sudo yum install -y zsh-autosuggestions autojump zsh-syntax-highlighting

sudo yum install -y fish

sudo yum install -y cscope
sudo curl -sLf https://spacevim.org/cn/install.sh | bash
